package ru.neoflex.dataobject.exceptions;

import static ru.neoflex.dataobject.utils.Utils.*;

public class PropertyIsReadonlyException extends RuntimeException {
    private final Class klass;
    private final String property;

    public PropertyIsReadonlyException(Class klass, String property) {
        super("DataObject, based on class " + String.valueOf(klass) + " does not have writable property `" + String.valueOf(property) + "`");

        assertNotNull(klass);
        assertNotNull(property);

        this.klass = klass;
        this.property = property;
    }

    public Class getKlass() {
        return klass;
    }

    public String getProperty() {
        return property;
    }
}
